import { IsEmail, IsNotEmpty, MinLength } from "class-validator";
import { ApiProperty } from "@nestjs/swagger";

export class UpdateUserPasswordDto {
    // 增加用户名--忘记密码时使用用户名 + 邮箱验证（之前是userid）
    @IsNotEmpty ({
        message: "用户名不能为空"
    })
    @ApiProperty()
    username: string;

    @IsNotEmpty({
        message: "密码不能为空"
    })
    @MinLength(6, {
        message: "密码不能小于6位"
    })
    @ApiProperty()
    password: string;

    @IsEmail({}, {
        message: "邮箱格式不合法"
    })
    @IsNotEmpty({
        message: "邮箱不能为空"
    })
    @ApiProperty()
    email: string;

    @IsNotEmpty({
        message: "验证码不能为空"
    })
    @ApiProperty()
    captcha: string;
}